package test.com.linkgie.galaxyframework.binaryserialize;

import com.linkgie.galaxyframework.binaryserialize.BinaryType;
import com.linkgie.galaxyframework.binaryserialize.BinaryField;
import com.linkgie.galaxyframework.binaryserialize.PrimitiveType;

import utils.Bytes;

@BinaryType(code= KVSetOperation.TX_OP_DATA_ACC_SET)
public interface KVSetOperation2 extends Operation {
	
	@BinaryField(index=2, primitiveType=PrimitiveType.BYTES)
	Bytes getAccountAddress();
	
	@BinaryField(index=3, iterable=true, isObject=true)
	KVWriteEntry[] getWriteSet();
	
	
	@BinaryType(code=KVSetOperation.TX_OP_DATA_ACC_SET_KV)
	public static interface KVWriteEntry{

		@BinaryField(index=1, primitiveType=PrimitiveType.TEXT)
		String getKey();

		@BinaryField(index=2, primitiveType = PrimitiveType.BYTES)
		byte[] getValue();

		@BinaryField(index=3, primitiveType=PrimitiveType.INT64)
		long getExpectedVersion();
	}

}
